include ../agemu.gcc.mk
include ../agemu.android.mk

C_SRC := src/boards/emu2413.c    \
	src/drivers/common/nes_ntsc.c  \
	src/utils/ConvertUTF.c      

CPP_SRCS := src/asm.cpp \
	src/boards/01-222.cpp \
	src/boards/09-034a.cpp \
	src/boards/103.cpp \
	src/boards/106.cpp \
	src/boards/108.cpp \
	src/boards/112.cpp \
	src/boards/116.cpp \
	src/boards/117.cpp \
	src/boards/120.cpp \
	src/boards/121.cpp \
	src/boards/12in1.cpp \
	src/boards/15.cpp \
	src/boards/151.cpp \
	src/boards/156.cpp \
	src/boards/158B.cpp \
	src/boards/164.cpp \
	src/boards/168.cpp \
	src/boards/170.cpp \
	src/boards/175.cpp \
	src/boards/176.cpp \
	src/boards/177.cpp \
	src/boards/178.cpp \
	src/boards/18.cpp \
	src/boards/183.cpp \
	src/boards/185.cpp \
	src/boards/186.cpp \
	src/boards/187.cpp \
	src/boards/189.cpp \
	src/boards/193.cpp \
	src/boards/199.cpp \
	src/boards/206.cpp \
	src/boards/208.cpp \
	src/boards/222.cpp \
	src/boards/225.cpp \
	src/boards/228.cpp \
	src/boards/230.cpp \
	src/boards/232.cpp \
	src/boards/234.cpp \
	src/boards/235.cpp \
	src/boards/244.cpp \
	src/boards/246.cpp \
	src/boards/252.cpp \
	src/boards/253.cpp \
	src/boards/28.cpp \
	src/boards/32.cpp \
	src/boards/33.cpp \
	src/boards/34.cpp \
	src/boards/36.cpp \
	src/boards/3d-block.cpp \
	src/boards/40.cpp \
	src/boards/41.cpp \
	src/boards/411120-c.cpp \
	src/boards/42.cpp \
	src/boards/43.cpp \
	src/boards/46.cpp \
	src/boards/50.cpp \
	src/boards/51.cpp \
	src/boards/57.cpp \
	src/boards/603-5052.cpp \
	src/boards/62.cpp \
	src/boards/65.cpp \
	src/boards/67.cpp \
	src/boards/68.cpp \
	src/boards/69.cpp \
	src/boards/71.cpp \
	src/boards/72.cpp \
	src/boards/77.cpp \
	src/boards/79.cpp \
	src/boards/80.cpp \
	src/boards/8157.cpp \
	src/boards/82.cpp \
	src/boards/8237.cpp \
	src/boards/830118C.cpp \
	src/boards/88.cpp \
	src/boards/8in1.cpp \
	src/boards/90.cpp \
	src/boards/91.cpp \
	src/boards/96.cpp \
	src/boards/99.cpp \
	src/boards/a9746.cpp \
	src/boards/ac-08.cpp \
	src/boards/addrlatch.cpp \
	src/boards/ax5705.cpp \
	src/boards/bandai.cpp \
	src/boards/bb.cpp \
	src/boards/bmc13in1jy110.cpp \
	src/boards/bmc42in1r.cpp \
	src/boards/bmc64in1nr.cpp \
	src/boards/bmc70in1.cpp \
	src/boards/BMW8544.cpp \
	src/boards/bonza.cpp \
	src/boards/bs-5.cpp \
	src/boards/cityfighter.cpp \
	src/boards/coolboy.cpp \
	src/boards/dance2000.cpp \
	src/boards/datalatch.cpp \
	src/boards/dream.cpp \
	src/boards/edu2000.cpp \
	src/boards/eh8813a.cpp \
	src/boards/et-100.cpp \
	src/boards/et-4320.cpp \
	src/boards/F-15.cpp \
	src/boards/famicombox.cpp \
	src/boards/ffe.cpp \
	src/boards/fk23c.cpp \
	src/boards/ghostbusters63in1.cpp \
	src/boards/gs-2004.cpp \
	src/boards/gs-2013.cpp \
	src/boards/h2288.cpp \
	src/boards/hp898f.cpp \
	src/boards/inlnsf.cpp \
	src/boards/karaoke.cpp \
	src/boards/kof97.cpp \
	src/boards/ks7010.cpp \
	src/boards/ks7012.cpp \
	src/boards/ks7013.cpp \
	src/boards/ks7016.cpp \
	src/boards/ks7017.cpp \
	src/boards/ks7030.cpp \
	src/boards/ks7031.cpp \
	src/boards/ks7032.cpp \
	src/boards/ks7037.cpp \
	src/boards/ks7057.cpp \
	src/boards/le05.cpp \
	src/boards/lh32.cpp \
	src/boards/lh53.cpp \
	src/boards/malee.cpp \
	src/boards/mihunche.cpp \
	src/boards/mmc1.cpp \
	src/boards/mmc2and4.cpp \
	src/boards/mmc3.cpp \
	src/boards/mmc5.cpp \
	src/boards/n106.cpp \
	src/boards/n625092.cpp \
	src/boards/novel.cpp \
	src/boards/onebus.cpp \
	src/boards/pec-586.cpp \
	src/boards/rt-01.cpp \
	src/boards/sa-9602b.cpp \
	src/boards/sachen.cpp \
	src/boards/sb-2000.cpp \
	src/boards/sc-127.cpp \
	src/boards/sheroes.cpp \
	src/boards/sl1632.cpp \
	src/boards/subor.cpp \
	src/boards/super24.cpp \
	src/boards/supervision.cpp \
	src/boards/t-227-1.cpp \
	src/boards/t-262.cpp \
	src/boards/tengen.cpp \
	src/boards/tf-1201.cpp \
	src/boards/transformer.cpp \
	src/boards/unrom512.cpp \
	src/boards/vrc1.cpp \
	src/boards/vrc2and4.cpp \
	src/boards/vrc3.cpp \
	src/boards/vrc5.cpp \
	src/boards/vrc6.cpp \
	src/boards/vrc7.cpp \
	src/boards/vrc7p.cpp \
	src/boards/yoko.cpp \
	src/boards/__dummy_mapper.cpp \
	src/cart.cpp \
	src/cheat.cpp \
	src/conddebug.cpp \
	src/config.cpp \
	src/debug.cpp \
	src/drawing.cpp \
	src/drivers/common/args.cpp \
	src/drivers/common/cheat.cpp \
	src/drivers/common/config.cpp \
	src/drivers/common/configSys.cpp \
	src/drivers/common/hq2x.cpp \
	src/drivers/common/hq3x.cpp \
	src/drivers/common/scale2x.cpp \
	src/drivers/common/scale3x.cpp \
	src/drivers/common/scalebit.cpp \
	src/drivers/common/vidblit.cpp \
	src/emufile.cpp \
	src/fceu.cpp \
	src/fds.cpp \
	src/file.cpp \
	src/filter.cpp \
	src/ines.cpp \
	src/input/arkanoid.cpp \
	src/input/bworld.cpp \
	src/input/cursor.cpp \
	src/input/fkb.cpp \
	src/input/ftrainer.cpp \
	src/input/hypershot.cpp \
	src/input/mahjong.cpp \
	src/input/mouse.cpp \
	src/input/oekakids.cpp \
	src/input/pec586kb.cpp \
	src/input/powerpad.cpp \
	src/input/quiz.cpp \
	src/input/shadow.cpp \
	src/input/snesmouse.cpp \
	src/input/suborkb.cpp \
	src/input/toprider.cpp \
	src/input/zapper.cpp \
	src/input.cpp \
	src/netplay.cpp \
	src/nsf.cpp \
	src/palette.cpp \
	src/ppu.cpp \
	src/sound.cpp \
	src/state.cpp \
	src/unif.cpp \
	src/utils/backward.cpp \
	src/utils/crc32.cpp \
	src/utils/endian.cpp \
	src/utils/general.cpp \
	src/utils/guid.cpp \
	src/utils/ioapi.cpp \
	src/utils/md5.cpp \
	src/utils/memory.cpp \
	src/utils/unzip.cpp \
	src/utils/xstring.cpp \
	src/video.cpp \
	src/vsuni.cpp \
	src/wave.cpp \
	src/x6502.cpp \
	#	src/lua-engine.cpp \
	#	src/movie.cpp \
	#	src/oldmovie.cpp \
		#src/drivers/sdl/gui.cpp \
		#src/drivers/sdl/sdl-netplay.cpp \
	#src/drivers/videolog/nesvideos-piece.cpp \
	#src/drivers/videolog/rgbtorgb.cpp \
	
WIN_C_SRCS := 	src/drivers/win/zlib/adler32.c  \
	src/drivers/win/zlib/compress.c \
	src/drivers/win/zlib/crc32.c    \
	src/drivers/win/zlib/deflate.c  \
	src/drivers/win/zlib/example.c  \
	src/drivers/win/zlib/gzio.c     \
	src/drivers/win/zlib/infblock.c \
	src/drivers/win/zlib/infcodes.c \
	src/drivers/win/zlib/inffast.c  \
	src/drivers/win/zlib/inflate.c  \
	src/drivers/win/zlib/inftrees.c \
	src/drivers/win/zlib/infutil.c  \
	src/drivers/win/zlib/maketree.c \
	src/drivers/win/zlib/trees.c    \
	src/drivers/win/zlib/uncompr.c  \
	src/drivers/win/zlib/unzip.c    \
	src/drivers/win/zlib/zutil.c   
	
WIN_CPP_SRCS := 	src/drivers/win/archive.cpp \
	src/drivers/win/args.cpp \
	src/drivers/win/aviout.cpp \
	src/drivers/win/cdlogger.cpp \
	src/drivers/win/cheat.cpp \
	src/drivers/win/common.cpp \
	src/drivers/win/config.cpp \
	src/drivers/win/debugger.cpp \
	src/drivers/win/debuggersp.cpp \
	src/drivers/win/directories.cpp \
	src/drivers/win/gui.cpp \
	src/drivers/win/guiconfig.cpp \
	src/drivers/win/help.cpp \
	src/drivers/win/input.cpp \
	src/drivers/win/joystick.cpp \
	src/drivers/win/keyboard.cpp \
	src/drivers/win/log.cpp \
	src/drivers/win/luaconsole.cpp \
	src/drivers/win/main.cpp \
	src/drivers/win/mapinput.cpp \
	src/drivers/win/memview.cpp \
	src/drivers/win/memviewsp.cpp \
	src/drivers/win/memwatch.cpp \
	src/drivers/win/monitor.cpp \
	src/drivers/win/movieoptions.cpp \
	src/drivers/win/netplay.cpp \
	src/drivers/win/ntview.cpp \
	src/drivers/win/OutputDS.cpp \
	src/drivers/win/palette.cpp \
	src/drivers/win/ppuview.cpp \
	src/drivers/win/pref.cpp \
	src/drivers/win/ramwatch.cpp \
	src/drivers/win/ram_search.cpp \
	src/drivers/win/replay.cpp \
	src/drivers/win/sound.cpp \
	src/drivers/win/state.cpp \
	src/drivers/win/taseditor/bookmark.cpp \
	src/drivers/win/taseditor/bookmarks.cpp \
	src/drivers/win/taseditor/branches.cpp \
	src/drivers/win/taseditor/editor.cpp \
	src/drivers/win/taseditor/greenzone.cpp \
	src/drivers/win/taseditor/history.cpp \
	src/drivers/win/taseditor/inputlog.cpp \
	src/drivers/win/taseditor/laglog.cpp \
	src/drivers/win/taseditor/markers.cpp \
	src/drivers/win/taseditor/markers_manager.cpp \
	src/drivers/win/taseditor/piano_roll.cpp \
	src/drivers/win/taseditor/playback.cpp \
	src/drivers/win/taseditor/popup_display.cpp \
	src/drivers/win/taseditor/recorder.cpp \
	src/drivers/win/taseditor/selection.cpp \
	src/drivers/win/taseditor/snapshot.cpp \
	src/drivers/win/taseditor/splicer.cpp \
	src/drivers/win/taseditor/taseditor_config.cpp \
	src/drivers/win/taseditor/taseditor_lua.cpp \
	src/drivers/win/taseditor/taseditor_project.cpp \
	src/drivers/win/taseditor/taseditor_window.cpp \
	src/drivers/win/taseditor.cpp \
	src/drivers/win/texthook.cpp \
	src/drivers/win/throttle.cpp \
	src/drivers/win/timing.cpp \
	src/drivers/win/tracer.cpp \
	src/drivers/win/video.cpp \
	src/drivers/win/wave.cpp \
	src/drivers/win/Win32InputBox.cpp \
	src/drivers/win/window.cpp \
	
SDL_CPP_SRCS :=	src/drivers/sdl/config.cpp \
	src/drivers/sdl/input.cpp \
	src/drivers/sdl/sdl-joystick.cpp \
	src/drivers/sdl/sdl-opengl.cpp \
	src/drivers/sdl/sdl-sound.cpp \
	src/drivers/sdl/sdl-throttle.cpp \
	src/drivers/sdl/sdl-video.cpp \
	src/drivers/sdl/sdl.cpp \
	src/drivers/sdl/unix-netplay.cpp
	
TOC_SRCS := lfceux.cpp
	
	
CFLAGS += -DPSS_STYLE=1 -U_S9XLUA_H \
	-Wno-write-strings \
	-fexceptions 


	
MAIN_SRC := agemu_fceux.cpp


LD := $(ARCH)g++
	
	
SO := fceux.so

LDFLAGS += -lz
	
#OBJS := $(C_SRC:.c=.o) $(CPP_SRCS:.cpp=.o) $(TOC_SRCS:.cpp=.o) $(MAIN_SRC:.cpp=.o)

SRC := $(C_SRC)   $(TOC_SRCS) $(MAIN_SRC) $(CPP_SRCS)

#排除有关win源码
#OBJS += $(WIN_CPP_SRCS:.cpp=.o)

CFLAGS += -O2
CXXFLAGS += -fpermissive

include ../agemu.build.mk
	
src/palettes/conv.o:src/palettes/conv.c
	g++ -c -o $(@) $(<)


	